﻿var customerWithCurrentDoBHeader = html.data([
    { field: 'FullName', label: 'Họ và tên' },
    { field: 'DateOfBirth', label: 'Ngày sinh', type: 'date' },
    { field: 'Email', label: 'Email' }
]);

var customerWithCurrentDoB = html.data([]);
$(function () {
    html.get('#customerCredit tbody').each(customerWithCurrentDoB, function (customer, index) {
        html.get(this).tr().each(customerWithCurrentDoBHeader, function (header) {
            var data = header.type === 'date'
                ? utils.formatDate(customer[header.field])
                : customer[header.field];
            html.get(this).td(data);
        });
    });

    utils.ajax({
        url: '/Account/CustomerWithDateOfBirthInCurrentMonth',
        success: function (data) {
            customerWithCurrentDoB(data);
        }
    });
    //$('#customerCredit').dataTable({
    //    bFilter: false,
    //    bLengthChange: false,
    //    paging: false
    //});
});